package com.tensquare.spit.controller;

import dto.ResultDTO;
import dto.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class BaseExceptionHandler {
    /**
     * 异常处理方法
     */
    @ExceptionHandler
    public ResultDTO errorHandler(Throwable e) {
        System.out.println("模拟发送邮件");
        e.printStackTrace();
        return new ResultDTO(false, StatusCode.OK, e.getMessage());
    }

}
